package com.leruan.aasimp.dao.impl;

import java.util.List;
import java.util.Map;


import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.leruan.aasimp.dao.CarTypeDao;
import com.leruan.aasimp.entity.CarType;

public class CarTypeDaoImpl extends HibernateDaoSupport implements CarTypeDao{

	public void delete(CarType carType) {
		getHibernateTemplate().delete(carType);
	}

	public List<CarType> findAll() {
		Session session=this.getSession();
		String hql="from CarType";
		Query query=session.createQuery(hql);
		List<CarType> results=query.list();
		return results;
	}

	public CarType findById(long findById) {
		// TODO Auto-generated method stub
		return null;
	}

	public CarType findByUserId(long parseLong) {
		// TODO Auto-generated method stub
		return null;
	}

	public List<CarType> getByList(Map<String, String> map, int pageNo) {
		// TODO Auto-generated method stub
		return null;
	}

	public Long getTotal(Map<String, String> map) {
		// TODO Auto-generated method stub
		return null;
	}

	public void update(CarType carType) {
		getHibernateTemplate().update(carType);
		
	}

	public void addType(CarType carType) {
		Session session = this.getSession();
		session.save(carType);
	}

	public List<CarType> findByCom(long parseLong) {
		Session session=this.getSession();
		String hql="from CarType where idCompany="+parseLong;
		Query query=session.createQuery(hql);
		List<CarType> results=query.list();
		return results;
	}


}
